package com.yima.baseproj.module.sys.teacher.clazz;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yima.baseproj.module.sys.clazz.ClassEntity;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherClassService extends ServiceImpl<TeacherClassMapper,TeacherClassEntity> {

    public List<ClassEntity> getTeacherClass(int teacherId){
        //根据teacher_id获取班级信息
        return baseMapper.selectClassByTeacher(teacherId);
    }

    public void delByTeacherId(int teacherId){
        baseMapper.delete(Wrappers.<TeacherClassEntity>query().eq("teacher_id",teacherId));
    }
}
